# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: Exp $

EAPI="2"

inherit eutils

DESCRIPTION="Quamachi is a Hamachi GUI for Linux, residing in the System Tray"
SRC_URI="http://quamachi.googlecode.com/files/Quamachi-${PV}.tar.bz2"
HOMEPAGE="http://code.google.com/p/quamachi/"


IUSE=""
SLOT="0"
LICENSE="GPL-3"
KEYWORDS="~x86 ~amd64 ~ppc ~ia64"

DEPEND="dev-python/PyQt4
	net-misc/hamachi"

S="${WORKDIR}/${PN}/Build"
T="${WORKDIR}/${PN}"
src_unpack() {
    unpack ${A}
}

src_compile() {
    cd "${S}"
    ls 
    emake || die "emake failed."
}

src_install() {
        mkdir -p "${D}/usr/sbin/" "${D}/usr/bin/" "${D}/usr/share/applications/" "${D}/usr/share/icons/hicolor/32x32/apps/" "${D}/usr/share/Quamachi/"
        cp "${T}/Bin/tuncfg-Quamachi" "${D}/usr/sbin/"
        cp -r "${T}/Build/" "${D}/usr/share/Quamachi/"
        cp -r "${T}/Desktop/" "${D}/usr/share/Quamachi/"
        cp -r "${T}/Image/" "${D}/usr/share/Quamachi/"
        cp -r --preserve=mode "${T}/Source/" "${D}/usr/share/Quamachi/"
        chmod 755 "${D}/usr/share/Quamachi/Source/"
        cp -r "${T}/Options/" "${D}/usr/share/Quamachi/"
        cp -r "${T}/Testing/" "${D}/usr/share/Quamachi/"
        dosym "/usr/share/Quamachi/Source/Quamachi.pyw" "/usr/bin/Quamachi.pyw"
        cp "${T}/Desktop/Menu/Quamachi.desktop" "${D}/usr/share/applications/"
        cp "${T}/Image/apps/Quamachi.png" "${D}/usr/share/icons/hicolor/32x32/apps/"
}
